﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="nList.aspx.cs" Inherits="nList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>交涉清單</h2>
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="View1" runat="server">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AutoGenerateColumns="False" DataKeyNames="NId" DataSourceID="SqlnList">
                    <Columns>
                        <asp:BoundField DataField="WId" HeaderText="通緝編號" SortExpression="WId" />
                        <asp:BoundField DataField="NId" HeaderText="交涉編號" InsertVisible="False" 
                            ReadOnly="True" SortExpression="NId" />
                        <asp:BoundField DataField="NDate" HeaderText="交涉日期" SortExpression="NDate" 
                            DataFormatString="{0:d}" />
                        <asp:BoundField DataField="MName" HeaderText="交涉人" SortExpression="MName" />
                        <asp:BoundField DataField="NGName" HeaderText="貨名" SortExpression="NGName" />
                        <asp:BoundField DataField="NGAmount" HeaderText="提供數量" 
                            SortExpression="NGAmount" />
                        <asp:BoundField DataField="NDealDate" HeaderText="交貨日期" 
                            SortExpression="NDealDate" DataFormatString="{0:d}" />
                        <asp:BoundField DataField="NGBudget" HeaderText="估價" 
                            SortExpression="NGBudget" />
                        <asp:HyperLinkField DataNavigateUrlFields="NId" 
                            DataNavigateUrlFormatString="~/nDetail.aspx?NId={0}" DataTextField="NId" 
                            DataTextFormatString="連至{0}號交涉細項" HeaderText="交涉細節" />
                    </Columns>
                </asp:GridView>
            </asp:View>
            <asp:View ID="View2" runat="server">
                此通緝令尚未有人新增交涉
            </asp:View>
        </asp:MultiView>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlnList" runat="server" 
            ConnectionString="<%$ ConnectionStrings:projectConnectionString %>" 
            SelectCommand="SELECT Negotiation.NId, Negotiation.NGAmount, Negotiation.WId, Negotiation.NDealDate, Negotiation.NDate, Negotiation.NGName, Negotiation.NGBudget, Member.MName FROM Negotiation INNER JOIN Member ON Negotiation.MId = Member.MId WHERE (Negotiation.WId = @WId)">
            <SelectParameters>
                <asp:QueryStringParameter DefaultValue="" Name="WId" QueryStringField="WId" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
</asp:Content>

